<?php 



	if(!isset($_SESSION['username'])){
		echo "<script>alert('请登录！');window.location.href='index.php?m=admin&c=manage'</script>";die;
	}


	authonity($con);



	$p = isset($_GET['p'])?$_GET['p']:1;
	
	
	$num = 3;
	//除去的条数
	$c = ($p-1)*$num;

	$rows = count(dbselect($con,'banner'));

	$feild = 'banner.id,banner.path,banner.status,banner.create_time,category_name';
	// $feild = '*';
	$data = dbselect($con,'banner,category',$feild,'banner.cate_id=category.id',"banner.cate_id","{$c},{$num}");


	$page = page($con,'banner',$p,$rows,$num);

/****************************************记住密码****************************/



/***********************************************************************/




/*********************************无刷新分页**************************************/

foreach($data as $k=>$v){
	$data[$k]['create_time'] = date('Y-m-d H:i:s',$v['create_time']);


	$data[$k]['path'] = json_decode($v['path']);
}


if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])=='xmlhttprequest'){

	$list['page'] = $page ;

	$list['data'] = $data ; 

	$list['imgsrc'] = IMG ;

	echo json_encode($list) ;die;



}









/***********************************************************************/
assign('con',$con);

assign('data',$data);

assign('page',$page);














?>